package org.hepeng.workx.bean.factory;


import org.hepeng.workx.extension.XPoint;

import java.lang.annotation.Annotation;
import java.util.List;

/**
 * @author he peng
 */

@XPoint("composite")
public interface ObjectFactory {

    <T> T getInstance(Class<T> type) throws Exception;

    <T> T getInstance(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) throws Exception;

    <T> List<Class<? extends T>> getInstances(Class<T> cls);

    <T> List<Class<? extends T>> getInstances(Class<T> cls , String packageName);

    List<Class> getInstancesWithAnnotation(Class<? extends Annotation> annotationClass);

    List<Class> getInstancesWithAnnotation(Class<? extends Annotation> annotationClass , String packageName);

}
